<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEnterprisesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('enterprises', function (Blueprint $table) {
            $table->increments('id');
            $table->uuid('user_id')->index();
            $table->string('name', 64);
            $table->string('logo')->nullable();
            $table->string('province')->nullable();
            $table->string('city')->nullable();
            $table->string('address')->nullable();
            $table->string('tax_no')->nullable()->comment('税号');
            $table->string('tax_img')->nullable()->comment('证件图片地址');
            $table->string('cert_no')->nullable()->comment('法人证件号码');
            $table->string('cert_name')->nullable()->comment('法人');
            $table->string('cert_img_front')->nullable()->comment('证件图片');
            $table->string('cert_img_back')->nullable()->comment('证件图片');

            $table->string('contact')->nullable()->comment('联系人');
            $table->string('mobile')->nullable()->comment('联系电话');
            $table->text('description');
            $table->boolean('valid');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('enterprises');
    }
}
